#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>



using namespace std;

class Person
{
public:
	virtual void Buy_Ticket()
	{
		cout << "Person -> Full price ticket" << endl;
	}

};

class Student : public Person
{
public:
	virtual void Buy_Ticket()
	{
		cout << "Student -> Half price ticket" << endl;
	}
};

void Func(Person& people)
{
	people.Buy_Ticket();
}

int main1()
{
	Person a;
	Student b;

	Func(a);
	Func(b);

	return 0;
}


class A
{
public:
	virtual void func(int val = 1)
	{
		cout << "A->" << val << endl;
	}
	virtual void Test()
	{
		func();
	}
};

class B : public A
{
public:
	virtual void func(int val = 0)
	{
		cout << "B->" << val << endl;
	}
};

int main()
{
	B* p = new B;
	p->Test();


	return 0;
}

